'''
author:        Wang Chenyang <cy-wang21@mails.tsinghua.edu.cn>
date:          2024-09-24
Copyright © Department of Physics, Tsinghua University. All rights reserved

Check data format for markdown files
'''

import literature_format as lf
from ai_tools import ALL_CATEGORIES
import os


def check_file():
    for cat_id, cat_name in enumerate(ALL_CATEGORIES):
        # print(chr(ord('A') + cat_id), cat_name)
        fname = "data/arXiv/%s.%s.md" % (
            chr(ord('A') + cat_id),
            cat_name.replace('\'', '').replace(" ", "_")
        )

        if os.path.exists(fname):
            print("Checking", fname)
            all_items = lf.markdown.parse_markdown_file(fname)


check_file()
